<form id="auto-data-form" action="doc/saveOrUpdate" class="form-horizontal bv-form" method="post" role="form">
	<div style="display: none;">
		<input id="model.id" name="model.id" value="#(model.id)" placeholder="主键" type="hidden" />
		<input id="model.typeId" name="model.typeId" value="#(model.typeId)" placeholder="知识分类" type="hidden" />
	</div>
	<div class="nav-tabs-custom">
		<ul class="nav nav-tabs">
			<li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true">基本信息</a></li>
            <li class=""><a id="atta_tab" href="#tab_2" data-toggle="tab" aria-expanded="false">知识附件</a></li>
		</ul>
		<div class="tab-content">
		    <div class="tab-pane active" id="tab_1">
				<div class="form-group">
					<label for="model.typeId" class="col-sm-2 control-label">知识分类</label>
					<div class="col-sm-10">
						<input id="model.typeName"  placeholder="知识分类" class="form-control input-md" required readonly="readonly"/>
					</div>
				</div>
				
				<div class="form-group">
					<label for="model.title" class="col-sm-2 control-label">知识标题</label>
					<div class="col-sm-10">
						<input id="model.title" name="model.title" value="#(model.title)" placeholder="标题" class="form-control input-md" required maxlength="256"/>
					</div>
				</div>
				
				<div class="form-group">
					<label for="model.keyword" class="col-sm-2 control-label">关键字</label>
					<div class="col-sm-10">
						<input id="model.keyword" name="model.keyword" value="#(model.keyword)" placeholder="关键字" class="form-control input-md" maxlength="512"/>
					</div>
				</div>
				
				<div class="form-group hide">
					<label for="model.ctime" class="col-sm-2 control-label">上传日期</label>
					<div class="col-sm-10">
						<input id="model.ctime" name="model.ctime" value="#date(model.ctime,"yyyy-MM-dd")" placeholder="上传日期" class="form-control input-md date" datetimepicker="yyyy-mm-dd" maxlength="19"/>
					</div>
				</div>
				
				<div class="form-group hide">
					<label for="model.userId" class="col-sm-2 control-label">上传人员</label>
					<div class="col-sm-10">
						<input id="model.userId" name="model.userId" value="#(model.userId)" placeholder="上传人员" class="form-control input-md" data-bv-integer maxlength="10" type="number"/>
					</div>
				</div>
				
				<div class="form-group hide">
					<label for="model.evaluate" class="col-sm-2 control-label">知识评星</label>
					<div class="col-sm-10">
						<input id="model.evaluate" name="model.evaluate" value="#(model.evaluate)" placeholder="知识评星" class="form-control input-md" maxlength="32"/>
					</div>
				</div>
			
				<div class="form-group">
					<label for="model.state" class="col-sm-2 control-label">知识状态</label>
					<div class="col-sm-4">
						#@dict_select("model.state",model.state,"DATA_STATE",false,"知识状态","required")
					</div>
					<label for="model.sort" class="col-sm-2 control-label">排序号</label>
					<div class="col-sm-4">
						<input id="model.sort" name="model.sort" value="#(model.sort)" placeholder="排序号" class="form-control input-md" required data-bv-integer maxlength="10" type="number"/>
					</div>
				</div>
				<div class="form-group">
					<label for="model.remark" class="col-sm-2 control-label">知识简介</label>
					<div class="col-sm-10">
						<textarea id="model.remark" name="model.remark" placeholder="知识简介" class="form-control input-md auto-editor" maxlength="1024">#(model.remark)</textarea>
					</div>
				</div>
            </div>
            <div class="tab-pane" id="tab_2">
				<div class="form-group">
					<div class="col-sm-12">
						<input id="doc_atta" name="doc_atta" data-title="知识附件" data-data-id="#(model.id)" data-image="false" data-file-num-limit="5" data-callback="" class="auto-file"/>
					</div>
				</div>	
            </div>
        </div>      
	</div>
</form>
<script type="text/javascript">
	$(document).ready(function() {
		if(jid("model.id").val()==""){
			jid("model.typeId").val(jid("query.type").val());
			jid("model.typeName").val(jid("temp.typeName").val());
		}		
		$("#atta_tab").click(function(){//刷新选择文件按钮的大小
			refreshUploader($($(this).attr("href")));
		});  
	});
</script>